/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * V3Colectivo.java
 *
 * Created on 14-may-2012, 12:46:55
 */
package practtica4;

/**
 *
 * @author usuario_local
 */
public class V3Colectivo extends javax.swing.JFrame {
    int iddoc;

    /** Creates new form V3Colectivo */
    public V3Colectivo() {
        initComponents();
    }

    V3Colectivo(int iddoc) {
        this.iddoc=iddoc;
        initComponents();
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        botonCrearNuevo = new javax.swing.JButton();
        botonAnyaBBDD = new javax.swing.JButton();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

        botonCrearNuevo.setText("Crear nuevo");
        botonCrearNuevo.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                botonCrearNuevoActionPerformed(evt);
            }
        });

        botonAnyaBBDD.setText("Añadir de la bbdd");
        botonAnyaBBDD.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                botonAnyaBBDDActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGap(154, 154, 154)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(botonAnyaBBDD)
                    .addComponent(botonCrearNuevo))
                .addContainerGap(129, Short.MAX_VALUE))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGap(57, 57, 57)
                .addComponent(botonCrearNuevo)
                .addGap(59, 59, 59)
                .addComponent(botonAnyaBBDD)
                .addContainerGap(138, Short.MAX_VALUE))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

private void botonCrearNuevoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_botonCrearNuevoActionPerformed
// TODO add your handling code here:
    V3ColectCrearNuevo v3ccn=new V3ColectCrearNuevo(iddoc);
    v3ccn.setVisible(true);
    this.dispose();
}//GEN-LAST:event_botonCrearNuevoActionPerformed

    private void botonAnyaBBDDActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_botonAnyaBBDDActionPerformed
        // TODO add your handling code here:
        V3colectAnyadirBBDD v3cabbdd=new V3colectAnyadirBBDD(iddoc);
        v3cabbdd.setVisible(true);
        this.dispose();
    }//GEN-LAST:event_botonAnyaBBDDActionPerformed

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        /* Set the Nimbus look and feel */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
         * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(V3Colectivo.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(V3Colectivo.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(V3Colectivo.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(V3Colectivo.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>

        /* Create and display the form */
        java.awt.EventQueue.invokeLater(new Runnable() {

            public void run() {
                new V3Colectivo().setVisible(true);
            }
        });
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton botonAnyaBBDD;
    private javax.swing.JButton botonCrearNuevo;
    // End of variables declaration//GEN-END:variables
}
